import os
import fnmatch
filepath1 = input('请输入文件夹路径：')
filetype1 = input('请输入文件类型：')
filetype1 = '*.'+filetype1
res = []
for filepath, dirnames, filenames in os.walk(filepath1):
        for filename in fnmatch.filter(filenames, filetype1):
                res.append(filename)
print(res)
